package com.frxuexi.lib_base.room

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import dagger.hilt.android.qualifiers.ApplicationContext

@Database(entities = [User::class,Leave::class], version = 1)
abstract class AppDataBase:RoomDatabase() {

    abstract fun userDao():UserDao

    abstract fun leaveDao():LeaveDao

    companion object{

        fun init(@ApplicationContext context: Context):AppDataBase{
            return Room.databaseBuilder(context,AppDataBase::class.java,"mdm2206")
                .build()
        }
    }

}